import fetch from 'common/src/utils/fetch'

/**
 * 根据任务ID查询考试名单名称列表
 * @param {*} data
 */
export function getExaminationNames(id) {
  return fetch({
    url: '/api/welcomeservice/examinationList/selectExaminationNameByTemplateId',
    method: 'get',
    params: {
      templateId: id
    }
  })
}

/**
 * 根据任务ID查询考试成绩名称列表
 * @param {*} data
 */
export function getScoreNames(id) {
  return fetch({
    url: '/api/welcomeservice/examinationScore/selectScoreNameByTemplateId',
    method: 'get',
    params: {
      templateId: id
    }
  })
}

/**
 * 上传考试名单
 * @param {*} data
 */
export function updateExamination(data) {
  return fetch({
    url: '/api/welcomeservice/examinationList',
    method: 'post',
    data
  })
}

/**
 * 上传考试成绩
 * @param {*} data
 */
export function updateScore(data) {
  return fetch({
    url: '/api/welcomeservice/examinationScore',
    method: 'post',
    data
  })
}

/**
 * 根据任务和名单名称查询考试名单分页详情
 * @param {
        templateId:1,
        importFileName:考试名单,
        studentId: '',
        pageNum_:1,
        pageSize_:2
    } data
 */
export function getExaminationList(data) {
  return fetch({
    url: '/api/welcomeservice/examinationList/selectExaminationListPage',
    method: 'post',
    data
  })
}

/**
 * 根据任务和成绩名称查询成绩名单分页详情
 * @param {
        templateId:1,
        importFileName:考试名单,
        pageNum_:1,
        pageSize_:2
    } data
 */
export function getScoreList(data) {
    return fetch({
      url: '/api/welcomeservice/examinationScore/selectExaminationScoreListPage',
      method: 'post',
      data
    })
  }

/**
 * 删除考试名单
 * @param {
        "templateId":1,
        "importFileName":"考试成绩"
    } data
 */
export function delExamList(data) {
    return fetch({
        url: '/api/welcomeservice/examinationList',
        method: 'delete',
        data
    })
}

/**
 * 删除考试成绩
 * @param {
        "templateId":1,
        "importFileName":"考试成绩"
    } data
 */
export function delScoreList(data) {
    return fetch({
        url: '/api/welcomeservice/examinationScore',
        method: 'delete',
        data
    })
}
